import { Module } from '@nestjs/common';
import { EmailService } from './email.service';
import { MailerModule } from '@nestjs-modules/mailer';
import { EjsAdapter } from '@nestjs-modules/mailer/dist/adapters/ejs.adapter';
import { join } from "path"
import { EmailController } from './email.controller';

@Module({
  imports: [
    MailerModule.forRoot({
      transport: {
        host: "smtp.qq.com",
        port: 465,
        auth: {
          user: "roulerchat@vip.qq.com",
          pass: "nbleungclrnpbgi"
        }
      },
      preview: false,
      template: {
        dir: join(process.cwd(), '/template/'),//这里就是你的ejs模板文件夹路径
        adapter: new EjsAdapter(),
        options: {
          strict: false,
        },

      }
    })
  ],
  providers: [EmailService],
  exports: [EmailService],
  controllers: [EmailController]
})
export class EmailModule { }
